<div class="row justify-content-center">
    <div class="col-8">
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
            <h2 id="jhi-deliver-offer-heading">Create or edit a Deliver Offer</h2>
            <div>
                <jhi-alert-error></jhi-alert-error>
                <div class="form-group" [hidden]="!deliverOffer.id">
                    <label for="id">ID</label>
                    <input type="text" class="form-control" id="id" name="id"
                        [(ngModel)]="deliverOffer.id" readonly />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_userId">User Id</label>
                    <input type="number" class="form-control" name="userId" id="field_userId"
                        [(ngModel)]="deliverOffer.userId" required/>
                    <div [hidden]="!(editForm.controls.userId?.dirty && editForm.controls.userId?.invalid)">
                        <small class="form-text text-danger"
                        [hidden]="!editForm.controls.userId?.errors?.required">
                        This field is required.
                        </small>
                        <small class="form-text text-danger"
                            [hidden]="!editForm.controls.userId?.errors?.number">
                            This field should be a number.
                        </small>
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_from">From</label>
                    <input type="text" class="form-control" name="from" id="field_from"
                        [(ngModel)]="deliverOffer.from" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_toPl">To Pl</label>
                    <input type="text" class="form-control" name="toPl" id="field_toPl"
                        [(ngModel)]="deliverOffer.toPl" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_location">Location</label>
                    <input type="text" class="form-control" name="location" id="field_location"
                        [(ngModel)]="deliverOffer.location" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_leaveDate">Leave Date</label>
                    <div class="d-flex">
                        <input id="field_leaveDate" type="datetime-local" class="form-control" name="leaveDate" [(ngModel)]="leaveDate"
                        />
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_arriveDate">Arrive Date</label>
                    <div class="d-flex">
                        <input id="field_arriveDate" type="datetime-local" class="form-control" name="arriveDate" [(ngModel)]="arriveDate"
                        />
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_transportType">Transport Type</label>
                    <input type="text" class="form-control" name="transportType" id="field_transportType"
                        [(ngModel)]="deliverOffer.transportType" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_status">Status</label>
                    <input type="text" class="form-control" name="status" id="field_status"
                        [(ngModel)]="deliverOffer.status" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_createdDate">Created Date</label>
                    <div class="d-flex">
                        <input id="field_createdDate" type="datetime-local" class="form-control" name="createdDate" [(ngModel)]="createdDate"
                        />
                    </div>
                </div>

            </div>
            <div>
                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span>Cancel</span>
                </button>
                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span>Save</span>
                </button>
            </div>
        </form>
    </div>
</div>
